<template>
  <div class="my-product">
    <h3>标题: {{ arr.proname }}</h3>
    <p>价格: {{ arr.proprice.toFixed(2) }}元</p>
    <p>{{ arr.info }}</p>
    <p>
      <button @click="kanFn">砍价</button>
    </p>
  </div>
</template>

<script>
export default {
  props: ["arr", "ind"], // 声明属性, 等待接收外部传入的值
  methods: {
    kanFn() {
      // this.$emit("kan", this.ind);
      this.$bus.$emit("aaa", this.ind);
    },
  },
};
</script>

<style scoped>
.my-product {
  width: 400px;
  padding: 20px;
  border: 2px solid #000;
  border-radius: 5px;
  margin: 10px;
}
</style>
